// 创建一个路由器，并暴露出去
// 第一步：引入createRouter
import {createRouter, createWebHistory} from 'vue-router'
// 引入一个一个可能要呈现组件
import Layout from '@/views/Layout.vue'
import Login from '@/views/Login.vue'
import Admin from '@/views/Admin.vue'
import Blog from '@/views/Blog.vue'
import BlogType from '@/views/BlogType.vue'
import Chart from "@/views/Chart.vue";
//创建路由器
const router = createRouter({
	history: createWebHistory(),
	routes: [
		{path: '/login', component: Login},
		{
			path: '/', component: Layout, children: [
				{path: '/chart', component: Chart},
				{path: '/admin', component: Admin},
				{path: '/blog', component: Blog},
				{path: '/type', component: BlogType}
			]
		}
	]
})

// 暴露出去router
export default router